import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class ActivityStarsVo {

  List<ActivityStarsData>? data;

  ActivityStarsMeta? meta;

  ActivityStarsVo({this.data, this.meta});

  ActivityStarsVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = <ActivityStarsData>[];
      json['data'].forEach((v) {
        data!.add(new ActivityStarsData.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new ActivityStarsMeta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class ActivityStarsData {
  int? id;
  String? productSn;
  int? categoryId;
  String? thumbnail;
  List<String>? images;
  String? title;
  String? marketPrice;
  String? price;
  int? status;
  Process? process;
  String? gratitude;

  ActivityStarsData(
      {this.id,
      this.productSn,
      this.categoryId,
      this.thumbnail,
      this.images,
      this.title,
      this.marketPrice,
      this.price,
      this.status,
      this.process,
      this.gratitude});

  ActivityStarsData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    productSn = json['product_sn'];
    categoryId = json['category_id'];
    thumbnail = json['thumbnail'];
    images = json['images'].cast<String>();
    title = json['title'];
    marketPrice = json['market_price'];
    price = json['price'];
    status = json['status'];
    process =
        json['process'] != null ? new Process.fromJson(json['process']) : null;
    gratitude = json['gratitude'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['product_sn'] = this.productSn;
    data['category_id'] = this.categoryId;
    data['thumbnail'] = this.thumbnail;
    data['images'] = this.images;
    data['title'] = this.title;
    data['market_price'] = this.marketPrice;
    data['price'] = this.price;
    data['status'] = this.status;
    if (this.process != null) {
      data['process'] = this.process!.toJson();
    }
    data['gratitude'] = this.gratitude;
    return data;
  }
}

class Process {
  String? title;
  List<String>? item;

  Process({this.title, this.item});

  Process.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    item = json['item'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['item'] = this.item;
    return data;
  }
}

class ActivityStarsMeta {
  List<PriceArea>? priceArea;
  String? price;
  CommonPagination? pagination;

  ActivityStarsMeta({this.priceArea, this.pagination, this.price});

  ActivityStarsMeta.fromJson(Map<String, dynamic> json) {
    price = json['price'];
    if (json['price_area'] != null) {
      priceArea = <PriceArea>[];
      json['price_area'].forEach((v) {
        priceArea!.add(new PriceArea.fromJson(v));
      });
    }
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['price'] = this.price;
    if (this.priceArea != null) {
      data['price_area'] = this.priceArea!.map((v) => v.toJson()).toList();
    }
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}

class PriceArea {
  String? label;
  String? value;

  PriceArea({this.label, this.value});

  PriceArea.fromJson(Map<String, dynamic> json) {
    label = json['label'];
    value = json['value'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['label'] = this.label;
    data['value'] = this.value;
    return data;
  }
}